﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Urgencias.Modelo
{
    class ConsultaMedica
    {
        private int idConsulta;

        public int ID_CONSULTA
        {
            get { return idConsulta; }
            set { idConsulta = value; }
        }
        private DateTime fechaConsulta;

        public DateTime FECHACONSULTA
        {
            get { return fechaConsulta; }
            set { fechaConsulta = value; }
        }
        private decimal costoConsulta;

        public decimal COSTO
        {
            get { return costoConsulta; }
            set { costoConsulta = value; }
        }
        private string tipoProcedimiento;

        public string TIPOPROCEDIMIENTO
        {
            get { return tipoProcedimiento; }
            set { tipoProcedimiento = value; }
        }

        private int boleta;

        public int BOLETA
        {
            get { return boleta; }
            set { boleta = value; }
        }

        private int box;

        public int BOX
        {
            get { return box; }
            set { box = value; }
        }

        string paciente;

        public string PACIENTE
        {
            get { return paciente; }
            set { paciente = value; }
        }

        string medicoEncargado;

        public string MEDICOENCARGADO
        {
            get { return medicoEncargado; }
            set { medicoEncargado = value; }
        }

        #region Enfermera
        public System.Collections.Generic.List<Enfermeria> enfermeraAtencion;
        
        /// <summary>
        /// Property for collection of Enfermera
        /// </summary>
        /// <pdGenerated>Default opposite class collection property</pdGenerated>
        public System.Collections.Generic.List<Enfermeria> EnfermeraAtencion
        {
            get
            {
                if (enfermeraAtencion == null)
                    enfermeraAtencion = new System.Collections.Generic.List<Enfermeria>();
                return enfermeraAtencion;
            }
            set
            {
                RemoveAllEnfermeraAtencion();
                if (value != null)
                {
                    foreach (Enfermeria oEnfermera in value)
                        AddEnfermeraAtencion(oEnfermera);
                }
            }
        }

        /// <summary>
        /// Add a new Enfermera in the collection
        /// </summary>
        /// <pdGenerated>Default Add</pdGenerated>
        public void AddEnfermeraAtencion(Enfermeria newEnfermera)
        {
            if (newEnfermera == null)
                return;
            if (this.enfermeraAtencion == null)
                this.enfermeraAtencion = new System.Collections.Generic.List<Enfermeria>();
            if (!this.enfermeraAtencion.Contains(newEnfermera))
                this.enfermeraAtencion.Add(newEnfermera);
        }

        /// <summary>
        /// Remove an existing Enfermera from the collection
        /// </summary>
        /// <pdGenerated>Default Remove</pdGenerated>
        public void RemoveEnfermeraAtencion(Enfermeria oldEnfermera)
        {
            if (oldEnfermera == null)
                return;
            if (this.enfermeraAtencion != null)
                if (this.enfermeraAtencion.Contains(oldEnfermera))
                    this.enfermeraAtencion.Remove(oldEnfermera);
        }

        /// <summary>
        /// Remove all instances of Enfermera from the collection
        /// </summary>
        /// <pdGenerated>Default removeAll</pdGenerated>
        public void RemoveAllEnfermeraAtencion()
        {
            if (enfermeraAtencion != null)
                enfermeraAtencion.Clear();
        }

        #endregion

        #region Anestesista
        public System.Collections.Generic.List<Medico> anestesista;

        /// <summary>
        /// Property for collection of Medico
        /// </summary>
        /// <pdGenerated>Default opposite class collection property</pdGenerated>
        public System.Collections.Generic.List<Medico> Anestesista
        {
            get
            {
                if (anestesista == null)
                    anestesista = new System.Collections.Generic.List<Medico>();
                return anestesista;
            }
            set
            {
                RemoveAllAnestesista();
                if (value != null)
                {
                    foreach (Medico oMedico in value)
                        AddAnestesista(oMedico);
                }
            }
        }

        /// <summary>
        /// Add a new Medico in the collection
        /// </summary>
        /// <pdGenerated>Default Add</pdGenerated>
        public void AddAnestesista(Medico newMedico)
        {
            if (newMedico == null)
                return;
            if (this.anestesista == null)
                this.anestesista = new System.Collections.Generic.List<Medico>();
            if (!this.anestesista.Contains(newMedico))
            {
                this.anestesista.Add(newMedico);
                newMedico.AddAtencionDeAnestesista(this);
            }
        }

        /// <summary>
        /// Remove an existing Medico from the collection
        /// </summary>
        /// <pdGenerated>Default Remove</pdGenerated>
        public void RemoveAnestesista(Medico oldMedico)
        {
            if (oldMedico == null)
                return;
            if (this.anestesista != null)
                if (this.anestesista.Contains(oldMedico))
                {
                    this.anestesista.Remove(oldMedico);
                    oldMedico.RemoveAtencionDeAnestesista(this);
                }
        }

        /// <summary>
        /// Remove all instances of Medico from the collection
        /// </summary>
        /// <pdGenerated>Default removeAll</pdGenerated>
        public void RemoveAllAnestesista()
        {
            if (anestesista != null)
            {
                System.Collections.ArrayList tmpAnestesista = new System.Collections.ArrayList();
                foreach (Medico oldMedico in anestesista)
                    tmpAnestesista.Add(oldMedico);
                anestesista.Clear();
                foreach (Medico oldMedico in tmpAnestesista)
                    oldMedico.RemoveAtencionDeAnestesista(this);
                tmpAnestesista.Clear();
            }
        }

        #endregion
        
        public System.Collections.Generic.List<Insumo> InsumosConsulta;

        #region Arsenalera
        public System.Collections.Generic.List<Enfermeria> arsenalera;

        /// <summary>
        /// Property for collection of Enfermera
        /// </summary>
        /// <pdGenerated>Default opposite class collection property</pdGenerated>
        public System.Collections.Generic.List<Enfermeria> Arsenalera
        {
            get
            {
                if (arsenalera == null)
                    arsenalera = new System.Collections.Generic.List<Enfermeria>();
                return arsenalera;
            }
            set
            {
                RemoveAllArsenalera();
                if (value != null)
                {
                    foreach (Enfermeria oEnfermera in value)
                        AddArsenalera(oEnfermera);
                }
            }
        }

        /// <summary>
        /// Add a new Enfermera in the collection
        /// </summary>
        /// <pdGenerated>Default Add</pdGenerated>
        public void AddArsenalera(Enfermeria newEnfermera)
        {
            if (newEnfermera == null)
                return;
            if (this.arsenalera == null)
                this.arsenalera = new System.Collections.Generic.List<Enfermeria>();
            if (!this.arsenalera.Contains(newEnfermera))
            {
                this.arsenalera.Add(newEnfermera);
                newEnfermera.AddConsultaMedica(this);
            }
        }

        /// <summary>
        /// Remove an existing Enfermera from the collection
        /// </summary>
        /// <pdGenerated>Default Remove</pdGenerated>
        public void RemoveArsenalera(Enfermeria oldEnfermera)
        {
            if (oldEnfermera == null)
                return;
            if (this.arsenalera != null)
                if (this.arsenalera.Contains(oldEnfermera))
                {
                    this.arsenalera.Remove(oldEnfermera);
                    oldEnfermera.RemoveConsultaMedica(this);
                }
        }

        /// <summary>
        /// Remove all instances of Enfermera from the collection
        /// </summary>
        /// <pdGenerated>Default removeAll</pdGenerated>
        public void RemoveAllArsenalera()
        {
            if (arsenalera != null)
            {
                System.Collections.ArrayList tmpArsenalera = new System.Collections.ArrayList();
                foreach (Enfermeria oldEnfermera in arsenalera)
                    tmpArsenalera.Add(oldEnfermera);
                arsenalera.Clear();
                foreach (Enfermeria oldEnfermera in tmpArsenalera)
                    oldEnfermera.RemoveConsultaMedica(this);
                tmpArsenalera.Clear();
            }
        }
        #endregion

        public ConsultaMedica()
        {
            InsumosConsulta = new List<Insumo>();
        }
    }
}
